import request from '@/axios/request';

enum api {
    ADD_RECIPIENT = '/certif/add_CertificateCode',
    QUERY_RECIPIENTS = '/certif/query_CertificateCode?',
    ADD_ONE_RECIPIENT= '/certif/add_oneCertificateCode',
    DEL_RECIPIENT = '/certif/del_oneCertificateCode?id='
}

// 添加收件人
export const addRecipient = () => {
    return request.post(api.ADD_RECIPIENT);
}

// 查询收件人
export const queryRecipients = (Item:string,CertificateCode:string,page:number,page_size:number) => {
    return request.get(api.QUERY_RECIPIENTS+`Item=${Item}&CertificateCode=${CertificateCode}&page=${page}&page_size=${page_size}`);
}

// 修改
export const addOneRecipient = (data: any) => {
    return request.post(api.ADD_ONE_RECIPIENT, data);
}

// 删除收件人
export const deleteRecipient = (id:string,) => {
    return request.delete(api.DEL_RECIPIENT + id);
}